import java.util.Scanner;

public class BinaryToOctal {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter a binary number: ");
        String binaryString = input.nextLine();
        int binary = Integer.parseInt(binaryString, 2);
        String octalString = Integer.toOctalString(binary);
        System.out.println("The octal conversion of " + binaryString + " is " + octalString);
    }
}